import request from '@/utils/request'

// 查询租赁合同列表
export function listLeasecontract(query) {
  return request({
    url: '/fang/leasecontract/list',
    method: 'get',
    params: query
  })
}

// 查询租赁合同详细
export function getLeasecontract(id) {
  return request({
    url: '/fang/leasecontract/' + id,
    method: 'get'
  })
}

export function saveDraftLeasecontract(data) {
  return request({
    url: '/fang/leasecontract/save-draft',
    method: 'post',
    data: data
  })
}

export function saveContractLeasecontract(data) {
  return request({
    url: '/fang/leasecontract/save-contract',
    method: 'post',
    data: data
  })
}

// 删除草稿
export function deleteDraftLeasecontract(id) {
  return request({
    url: '/fang/leasecontract/delete-draft/' + id,
    method: 'delete'
  })
}


// 新增租赁合同
export function addLeasecontract(data) {
  return request({
    url: '/fang/leasecontract',
    method: 'post',
    data: data
  })
}

// 修改租赁合同
export function updateLeasecontract(data) {
  return request({
    url: '/fang/leasecontract',
    method: 'put',
    data: data
  })
}

// 删除租赁合同
export function delLeasecontract(id) {
  return request({
    url: '/fang/leasecontract/' + id,
    method: 'delete'
  })
}

// 获取未完成合同数量
export function getUnfinishedCount() {
  return request({
    url: '/fang/leasecontract/unfinished-count',
    method: 'get'
  })
}

// 获取续期提醒内容
export function getLeasecontractReminder(id) {
  return request({
    url: '/fang/leasecontract/reminder/' + id,
    method: 'get'
  })
}

// 确认发送续期提醒
export function confirmLeasecontractReminder(data) {
  return request({
    url: '/fang/leasecontract/confirmreminder',
    method: 'post',
    data: data
  })
}
